#ifndef DATE_H_INCLUDED
#define DATE_H_INCLUDED

#include <time.h>

#ifdef __cplusplus
extern "C"
{
#endif

//------------------------------------------------------------------------------
// functions
//------------------------------------------------------------------------------

/* 
 * @return A dynamically allocated string containing the local date and time
 *         in the format "Sat May 20 15:21:51 2000".
 *
 * @warning The caller must call free() to release the allocated memory.
 */
char *
DATE_GetSystemDateTime();

/* 
 * @param input_time value returned by time()
 * 
 * @return day of the month corresponding to the input time
 */
int
DATE_GetDayOfMonth(const time_t input_time);

/* 
 * @return Return the current month and year in the form "November 2012".
 */
char *
DATE_GetPreviousMonthAndYearString();

/* Before calling DATE_ConvertToLocalTime, initialize internal data. 
@return true if initialization is successful, false otherwise. */

bool
DATE_Init();

/* This function should be called after DATE_Init. */

bool
DATE_ConvertLocalTime(const char* a_str);

int
DATE_CompareTime(const char* strTime1, const char* strTime2);

bool
DATE_ExtractLocalTime(char* timezn, char* buffer_localtime, unsigned int buffer_length);

void
DATE_Free();

#ifdef __cplusplus
}
#endif

#endif // DATE_H_INCLUDED
